package io;

import java.io.File;
//文件删除
public class IODEmo3 {
    public static void main(String[] args) throws InterruptedException {
        File file = new File("./text.txt");
        //boolean ret = file.delete();
        //System.out.println(ret);
        //退出时删除文件
        file.deleteOnExit();//退出之后删除的文件,称为"临时文件"
        Thread.sleep(5000);//时间结束文件就不见了
    }
}
